<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
  </ul>
  <button>添加</button>
</body>
<script>
  const ulEle = document.getElementsByTagName('ul')[0];
  const lis = document.getElementsByTagName('li');
  console.log(lis,"lis");
  const buttonEle = document.getElementsByTagName('button')[0];
  // buttonEle.addEventListener('click',function(){
  //   for (let i = 0; i < lis.length; i++) {
  //     const element = lis[i].cloneNode(true);
 
  //     console.dir(element);
  //     ulEle.appendChild(element);
  //     console.log(ulEle,"ulEle");
  //   }
  // })
</script>
</html>